/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package digitaldreamers.libraries.games.servers.databasemanagement.abstracts;

import digitaldreamers.libraries.games.servers.databasemanagement.concrete.DatabaseManagement.IsolationLevel;
import digitaldreamers.libraries.games.servers.databasemanagement.concrete.SqlParameter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author DaoLe
 */
public interface IDatabaseUtility {
    String getServerName();
    
    void setServerName(String pServerName);
    
    int getPort();
    
    void setPort(int pPort);
    
    String getDatabaseName();
    
    void setDatabaseName(String pDatabaseName);
    
    String getUsername();
    
    void setUsername(String pUsername);
    
    String getPassword();
    
    void setPassword(String pPassword);
    
    int getCommandTimeout();
    
    void setCommandTimeout(int pCommandTimeout);
    
    
    
    void closeOnCompletion(boolean pIsCloseOnCompletion);
    
    boolean isCloseOnCompletion();
    
    boolean isTransactionStarted();
    
    ResultSet executeQuery(String pSQLStatement) throws SQLException;
    
    ResultSet executeQuery(String pSQLStatement, SqlParameter[] pParameters) throws SQLException;
    
    int executeUpdate(String pSQLStatement) throws SQLException;
    
    int executeUpdate(String pSQLStatement, SqlParameter[] pParameters) throws SQLException;
    
    ResultSet executeQuerySP(String pStoredProcedureName) throws SQLException;
    
    ResultSet executeQuerySP(String pStoredProcedureName, SqlParameter[] pParameters) throws SQLException;
    
    int executeUpdateSP(String pStoredProcedureName) throws SQLException;
    
    int executeUpdateSP(String pStoredProcedureName, SqlParameter[] pParameters) throws SQLException;
    
    Statement executeSP(String pStoredProcedureName) throws SQLException;
    
    Statement executeSP(String pStoredProcedureName, SqlParameter[] pParameters) throws SQLException;
    
    void startTransaction(IsolationLevel pIsolationLevel) throws SQLException;
    
    void commitTransaction() throws SQLException;
    
    void rollbackTransaction() throws SQLException;
}